package com.swss.util;

import org.hibernate.criterion.Order;

public class OrderBy {
	private String type;
	private String filed;
	private Order order;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getFiled() {
		return filed;
	}

	public void setFiled(String filed) {
		this.filed = filed;
	}

	public Order getOrder() {
		if (order == null) {

			if (type.equals("desc")) {
				return Order.desc(filed);
			} else if (type.equals("asc")) {
				return Order.asc(filed);
			}

		}
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}
}
